package group2assignone.model;

/**
 * Abstract Class TicketComponent is the base class for the Ticket and TicketComposite
 * as part of the Composite Pattern.
 * @author group2
 */
public abstract class TicketComponent {

    /**
     * Adds a ticket to the current ticket combination.
     * @param ticket
     */
    public void addTicket(TicketComponent ticket) {
    }

    /**
     * Iterates through the ticket combination and books every ticket with
     * the bookingNum and itemNumber.
     * Returns the itemNumber (item within the booking).
     * @param bookingNum
     * @param itemNum
     * @return
     */
    public abstract int bookTicket(int bookingNum, int itemNum);

    /**
     * Returns the total cost of the ticket.
     * @return
     */
    public abstract double getCost();

    /**
     * returns a boolean indicating whether the flight indicated by the parameter
     * flightNum exists.
     * @param flightNum
     * @return
     */
    public abstract boolean containsFlight(String flightNum);

    /**
     * Returns a boolean which indicated whether the ticket was successfully booked.
     * @return
     */
    public abstract boolean isBooked();
}
